package com.zhixue.media.controller;

import com.zhixue.media.service.MediaFilesService;
import com.zhixue.model.RestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: 李 力
 * @Date: 2025/5/3
 * @Description: com.zhixue.media.controller
 * @version: 1.0
 */
@RestController
@RequestMapping("/open")
public class MediaOpenController {

    @Autowired
    MediaFilesService mediaFileService;

    @GetMapping("/preview/{mediaId}")
    public RestResponse<String> getPlayUrlByMediaId(@PathVariable String mediaId) {
        return mediaFileService.getFileById(mediaId);
    }
}
